package com.jie.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author jie
 * @since 2024-07-10
 */
@TableName("user_track")
@Data
public class UserTrack implements Serializable {

    private static final long serialVersionUID=1L;

    /**
     * 跑步与用户关联表
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 运动轨迹id
     */
    @TableField("track_id")
    private Integer trackId;

    /**
     * 用户id
     */
    @TableField("user_id")
    private Integer userId;
    /**
     * 跑步总距离
     */
    @TableField("run_distance")
    private Double runDistance;

    /**
     * 跑步总时长 s记录
     */
    private long runDate;

    /**
     * 消耗大卡
     */
    private Integer consumable;

    /**
     * 开始经度
     */
    private BigDecimal startLongitude;
    /**
     * 结束经度
     */
    private BigDecimal endLongitude;
    /**
     * 开始维度
     */
    private BigDecimal startLatitude;
    /**
     * 结束维度
     */
    private BigDecimal endLatitude;
    /**
     * 当前用户运动状态
     */
    private Integer trackStatus;
    /**
     * 用户设备的唯一标识 如果换设备就要先获取到历史记录在做处理
     */
    private String deviceId;
    /**
     * 结束日期
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    // 格式化
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime endDate;
    /**
     * 创建时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    // 格式化
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    // 格式化
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
